package com.mjh.zhujianju.enums;

public enum SupervisionLevelEnum {
	level_1(1,"一般"),
	level_2(2,"紧急"),
	level_3(3,"加急");

    private Integer code;
    private String name;

    SupervisionLevelEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static SupervisionLevelEnum[] getEnums(){
        return SupervisionLevelEnum.values();
    }

    public static String getName(Integer code){
        if(code == null){
            return null;
        }

        for (SupervisionLevelEnum SupervisionEnum : SupervisionLevelEnum.values()){
            if(code.equals(SupervisionEnum.getCode())){
                return SupervisionEnum.getName();
            }
        }

        return null;
    }
}
